package ar.unc.famaf.pln.giveselector.classifier;

import ar.unc.famaf.pln.giveselector.context.Utterance;

/**
 * Class that inherits from the ACLClassificator class.
 * This class redefines the getGrade method to consider
 * the BORROWED type of Classifications.
 * @author david
 *
 */
public class ACLClassifierB extends ACLClassifier {
	
	/**
	 * @return The grade for the given Utterance based on its list
	 * of ClassifiedOccurrences considering the BORROWED kind of
	 * ClassifiedOccurrences.
	 */
	@Override
	public float getScore(Utterance utt)
	{
		float result = 0f;
		if (utt instanceof UtteranceP)
		{
			UtteranceP uttp = (UtteranceP) utt;
			float nS = getNumberOf(uttp, ClassifiedOccurrence.S);
			float nF = getNumberOf(uttp, ClassifiedOccurrence.F);
			float nBS = getNumberOf(uttp, ClassifiedOccurrence.BS);
			float nBF = getNumberOf(uttp, ClassifiedOccurrence.BF);
			result = nS - nF + (nBS - nBF)/2f;
		}
		return result;
	}

}
